package club.xyes.zkh.ecommerce.commons.entity;

import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Table;

/**
 * Create by 郭文梁 2019/4/15 0015 11:55
 * User
 * 用户实体类
 *
 * @author 郭文梁
 * @data 2019/4/15 0015
 */
@EqualsAndHashCode(callSuper = true)
@Table(name = User.TABLE_NAME)
@Data
public class User extends BaseEntity {
    public static final String TABLE_NAME = "t_user";
    /**
     * name     varchar(100) not null comment '用户名',
     */
    @Column(name = "name", length = 100, nullable = false)
    private String name;
    /**
     * 用户头像
     */
    @Column(name = "avatar")
    private String avatar;
    /**
     * 微信OpenId
     */
    @Column(name = "wx_open_id")
    private String wxOpenId;
    /**
     * 商铺用户的微信OpenId
     */
    @Column(name = "shop_wx_open_id")
    private String shopWxOpenId;
    /**
     * 服务微信OpenId
     */
    @Column(name = "service_wx_open_id")
    private String serviceWxOpenId;
    /**
     * password varchar(100) not null comment '密码'
     */
    @Column(name = "password", length = 100, nullable = false)
    private String password;
    /**
     * 电话号码
     */
    @Column(name = "mobile", length = 30)
    private String mobile;
    /**
     * expired            bit          not null default 0 comment '是否过期',
     */
    @Column(name = "expired", nullable = false)
    private Boolean expired;
    /**
     * locked             bit          not null default 0 comment '是否锁定',
     */
    @Column(name = "locked", nullable = false)
    private Boolean locked;
    /**
     * credentials_expired bit          not null default 0 comment '凭证是否过期',
     */
    @Column(name = "credentials_expired", nullable = false)
    private Boolean credentialsExpired;
    /**
     * enabled            bit          not null default 1 comment '是否可用',
     */
    @Column(name = "enabled", nullable = false)
    private Boolean enabled;
    /**
     * authorities_string        varchar(255) null comment '权限',
     */
    @Column(name = "authorities_string")
    private String authoritiesString;
    /**
     * wx_session_key
     * 最后一次微信API会话SessionKey
     */
    @Column(name = "wx_session_key")
    private String wxSessionKey;
}
